<?php 
require_once '/config/config.php';
$connect=  mysql_connect(HOST.":".PORT,USER,PASS,DB) or die("khong the ket noi sever");
mysql_select_db(DB);
// Get data;
function getData($query){
    global $connect;
    $data=array();
    $result=  mysql_query($query);
    while($row=  mysql_fetch_assoc($result)){
        $data[]=$row;
    }
    return $data;
}
//Thao tac tren data;
function actionData($query){
    global $connect;
    return mysql_query($query);
}
//Lay so nguoi truy cap or search;
function getCount($path){
 $path=  realpath($path);
 $file=  fopen($path,"r");
 return fgets($file);
}
//dat lai so nguoi or search;
function setCount($path,$value){
 $file=  fopen($path,"w");
 return fwrite($file,$value);    
}
